home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / SETUP / US / CBUILDER / DATA.Z / IMM.PAS < prev    next >
Pascal/Delphi Source File  |  1997-02-13  |  27KB  |  596 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Run-time Library                         }
  5. {       Windows 32bit API Interface Unit                }
  6. {                                                       }
  7. {       Copyright (c) 1996 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Imm;
  12.  
  13. {$A+,Z+}
  14.  
  15. interface
  16.  
  17. uses Windows;
  18.  
  19. const
  20.   VK_PROCESSKEY = $E5;
  21.  
  22. type
  23.   HIMC = Integer;
  24.   {$nonamespace HIMC}
  25.  
  26.   PCompositionForm = ^TCompositionForm;
  27.   tagCOMPOSITIONFORM = record
  28.     dwStyle: DWORD;
  29.     ptCurrentPos: TPOINT;
  30.     rcArea: TRECT;
  31.   end;
  32.   {$nonamespace tagCOMPOSITIONFORM}
  33.   TCompositionForm = tagCOMPOSITIONFORM;
  34.  
  35.   PCandidateForm = ^TCandidateForm;
  36.   tagCANDIDATEFORM = record
  37.     dwIndex: DWORD;
  38.     dwStyle: DWORD;
  39.     ptCurrentPos: TPOINT;
  40.     rcArea: TRECT;
  41.   end;
  42.   {$nonamespace tagCANDIDATEFORM}
  43.   TCandidateForm = tagCANDIDATEFORM;
  44.  
  45.   PCandidateList = ^TCandidateList;
  46.   tagCANDIDATELIST = record
  47.     dwSize: DWORD;
  48.     dwStyle: DWORD;
  49.     dwCount: DWORD;
  50.     dwSelection: DWORD;
  51.     dwPageStart: DWORD;
  52.     dwPageSize: DWORD;
  53.     dwOffset: array[1..1] of DWORD;
  54.   end;
  55.   {$nonamespace tagCANDIDATELIST}
  56.   TCandidateList = tagCANDIDATELIST;
  57.  
  58.   PRegisterWordA = ^TRegisterWordA;
  59.   PRegisterWordW = ^TRegisterWordW;
  60.   PRegisterWord = PRegisterWordA;
  61.   tagREGISTERWORDA = record
  62.     lpReading: PAnsiChar;
  63.     lpWord: PAnsiChar;
  64.   end;
  65.   {$nonamespace tagREGISTERWORDA}
  66.   TRegisterWordA = tagREGISTERWORDA;
  67.   tagREGISTERWORDW = record
  68.     lpReading: PWideChar;
  69.     lpWord: PWideChar;
  70.   end;
  71.   {$nonamespace tagREGISTERWORDW}
  72.   TRegisterWordW = tagREGISTERWORDW;
  73.   TRegisterWord = TRegisterWordA;
  74.  
  75. const 
  76.   STYLE_DESCRIPTION_SIZE = 32;
  77.  
  78. type
  79.   PStyleBufA = ^TStyleBufA;
  80.   PStyleBufW = ^TStyleBufW;
  81.   PStyleBuf = PStyleBufA;
  82.   tagSTYLEBUFA = record
  83.     dwStyle: DWORD;
  84.     szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of AnsiChar; 
  85.   end;
  86.   {$nonamespace tagSTYLEBUFA}
  87.   TStyleBufA = tagSTYLEBUFA;
  88.   tagSTYLEBUFW = record
  89.     dwStyle: DWORD;
  90.     szDescription: array[0..STYLE_DESCRIPTION_SIZE-1] of WideChar; 
  91.   end;
  92.   {$nonamespace tagSTYLEBUFW}
  93.   TStyleBufW = tagSTYLEBUFW;
  94.   TStyleBuf = TStyleBufA;
  95.  
  96. { prototype of IMM API }
  97.  
  98. function ImmInstallIMEA(lpszIMEFileName, lpszLayoutText: PAnsiChar): HKL; stdcall;
  99. function ImmInstallIMEW(lpszIMEFileName, lpszLayoutText: PWideChar): HKL; stdcall;
  100. function ImmInstallIME(lpszIMEFileName, lpszLayoutText: PChar): HKL; stdcall;
  101.  
  102. function ImmGetDefaultIMEWnd(hWnd: HWND): HWND; stdcall;
  103.  
  104. function ImmGetDescriptionA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
  105. function ImmGetDescriptionW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
  106. function ImmGetDescription(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
  107.  
  108. function ImmGetIMEFileNameA(hKl: HKL; PAnsiChar: PAnsiChar; uBufLen: UINT): UINT; stdcall;
  109. function ImmGetIMEFileNameW(hKl: HKL; PWideChar: PWideChar; uBufLen: UINT): UINT; stdcall;
  110. function ImmGetIMEFileName(hKl: HKL; PChar: PChar; uBufLen: UINT): UINT; stdcall;
  111.  
  112. function ImmGetProperty(hKl: HKL; dWord: DWORD): DWORD; stdcall;
  113.  
  114. function ImmIsIME(hKl: HKL): Boolean; stdcall;
  115.  
  116. function ImmSimulateHotKey(hWnd: HWND; dWord: DWORD): Boolean; stdcall;
  117.  
  118. function ImmCreateContext: HIMC; stdcall;
  119. function ImmDestroyContext(hImc: HIMC): Boolean; stdcall;
  120. function ImmGetContext(hWnd: HWND): HIMC; stdcall;
  121. function ImmReleaseContext(hWnd: HWND; hImc: HIMC): Boolean; stdcall;
  122. function ImmAssociateContext(hWnd: HWND; hImc: HIMC): HIMC; stdcall;
  123.  
  124. function ImmGetCompositionStringA(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  125. function ImmGetCompositionStringW(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  126. function ImmGetCompositionString(hImc: HIMC; dWord1: DWORD; lpBuf: pointer; dwBufLen: DWORD): Longint; stdcall;
  127.  
  128. function ImmSetCompositionStringA(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  129. function ImmSetCompositionStringW(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  130. function ImmSetCompositionString(hImc: HIMC; dwIndex: DWORD; lpComp: pointer; dwCompLen: DWORD; lpRead: pointer; dwReadLen: DWORD):Boolean; stdcall;
  131.  
  132. function ImmGetCandidateListCountA(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  133. function ImmGetCandidateListCountW(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  134. function ImmGetCandidateListCount(hImc: HIMC; var ListCount: DWORD): DWORD; stdcall;
  135.  
  136. function ImmGetCandidateListA(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  137. function ImmGetCandidateListW(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  138. function ImmGetCandidateList(hImc: HIMC; deIndex: DWORD; lpCandidateList: PCANDIDATELIST; dwBufLen: DWORD): DWORD; stdcall;
  139.  
  140. function ImmGetGuideLineA(hImc: HIMC; dwIndex: DWORD; lpBuf: PAnsiChar; dwBufLen: DWORD): DWORD; stdcall;
  141. function ImmGetGuideLineW(hImc: HIMC; dwIndex: DWORD; lpBuf: PWideChar; dwBufLen: DWORD): DWORD; stdcall;
  142. function ImmGetGuideLine(hImc: HIMC; dwIndex: DWORD; lpBuf: PChar; dwBufLen: DWORD): DWORD; stdcall;
  143.  
  144. function ImmGetConversionStatus(hImc: HIMC; var Conversion, Sentence: DWORD): Boolean; stdcall;
  145. function ImmSetConversionStatus(hImc: HIMC; Conversion, Sentence: DWORD): Boolean; stdcall;
  146. function ImmGetOpenStatus(hImc: HIMC): Boolean; stdcall;
  147. function ImmSetOpenStatus(hImc: HIMC; fOpen: Boolean): Boolean; stdcall;
  148.  
  149. function ImmGetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
  150. function ImmGetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
  151. function ImmGetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
  152.  
  153. function ImmSetCompositionFontA(hImc: HIMC; lpLogfont: PLOGFONTA): Boolean; stdcall;
  154. function ImmSetCompositionFontW(hImc: HIMC; lpLogfont: PLOGFONTW): Boolean; stdcall;
  155. function ImmSetCompositionFont(hImc: HIMC; lpLogfont: PLOGFONT): Boolean; stdcall;
  156.  
  157. function ImmConfigureIMEA(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  158. function ImmConfigureIMEW(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  159. function ImmConfigureIME(hKl: HKL; hWnd: HWND; dwMode: DWORD; lpData: pointer): Boolean; stdcall;
  160.  
  161. function ImmEscapeA(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  162. function ImmEscapeW(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  163. function ImmEscape(hKl: HKL; hImc: HIMC; uEscape: UINT; lpData: pointer): LRESULT; stdcall;
  164.  
  165. function ImmGetConversionListA(hKl: HKL; hImc: HIMC; lpSrc: PAnsiChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  166. function ImmGetConversionListW(hKl: HKL; hImc: HIMC; lpSrc: PWideChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  167. function ImmGetConversionList(hKl: HKL; hImc: HIMC; lpSrc: PChar; lpDst: PCANDIDATELIST; dwBufLen: DWORD; uFlag: UINT ): DWORD; stdcall;
  168.  
  169. function ImmNotifyIME(hImc: HIMC; dwAction, dwIndex, dwValue: DWORD): Boolean; stdcall;
  170.  
  171. function ImmGetStatusWindowPos(hImc: HIMC; var lpPoint : TPoint): Boolean; stdcall;
  172. function ImmSetStatusWindowPos(hImc: HIMC; lpPoint: PPOINT): Boolean; stdcall;
  173. function ImmGetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
  174. function ImmSetCompositionWindow(hImc: HIMC; lpCompForm: PCOMPOSITIONFORM): Boolean; stdcall;
  175. function ImmGetCandidateWindow(hImc: HIMC; dwBufLen: DWORD; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
  176. function ImmSetCandidateWindow(hImc: HIMC; lpCandidate: PCANDIDATEFORM): Boolean; stdcall;
  177.  
  178. function ImmIsUIMessageA(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: LPARAM): Boolean; stdcall;
  179. function ImmIsUIMessageW(hWnd: HWND; msg: UINT; wParam: WPARAM; lParam: